package spec.ocl_mcg;

import graph.mcg.CGNode;
import graph.mcg.ConstraintNode;

import org.eclipse.ocl.ecore.VariableExp;


public class VariableExpNode extends TreeNode implements LeafNode {
	private String name;
	private String type;
	
	public VariableExpNode(){}
	
	public VariableExpNode(VariableExp exp){
		name = exp.getName();
		type = exp.getType().getName();
		expresult = exp.getName().substring(0, 1).toUpperCase() + exp.getName().substring(1);
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDatatype() {
		return type;
	}

	public void setDatatype(String datatype) {
		this.type = datatype;
	}

	@Override
	public CGNode toCG() {
		// TODO Auto-generated method stub
		ConstraintNode cfgnode = new ConstraintNode(this);
		cfgnode.setConstraint(name);
		cfgnode.setNextnode(null);
		return cfgnode;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return null;
	}

}
